﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using System.Diagnostics;
using Microsoft.Practices.Composite.Presentation.Regions;
using System.Windows;
using Microsoft.Practices.Composite.UnityExtensions;
using Infragistics.Windows.TilePanel;
using FXSStation.Modules.SharedInfrastructureModule.Extentions.RegionAdapters;

namespace FXSStation.Shell
{
    internal class Bootstrapper : UnityBootstrapper
    {
        protected override DependencyObject CreateShell()
        {
            ShellPresenter shellP = new ShellPresenter(new Shell());
            return shellP;
        }

        protected override IModuleCatalog GetModuleCatalog()
        {
            string currentDir = Environment.CurrentDirectory;
            Debug.WriteLine("Current Directory " + currentDir);
            return new DirectoryModuleCatalog() { ModulePath = @"..\..\..\Modules" };
        }

        protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
        {
            var mappings = base.ConfigureRegionAdapterMappings();
            mappings.RegisterMapping(typeof(WorkspaceItemsControl), new ItemsControlRegionAdapter(base.ConfigureDefaultRegionBehaviors()));
            return mappings;
        }
    }
    
}
